<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../react18/react.development.js"></script>
  <script src="../react18/react-dom.development.js"></script>
</head>
<style>
  .first {
    width: 400px;
    height: 300px;
    background-color: aqua;
  }
</style>

<body>
  <div id="app"></div>
  <script>
    /* 
      React对象上有一个createElement方法可以创建虚拟DOM
        - 参数1:元素名称
        - 参数2:元素上的属性,对象类型
        - 参数3....n:都是元素的子节点
    */

    /* //第一种
    // const vDom = React.createElement('h1', {
    //   className: "first"
    // }, "hellow react");

    //第二种
    // const vDom = React.createElement("h3", {
    //   className: "first"
    // }, "hello vDOM", "hello world");

    //第三种
    const vDom = React.createElement('div', {
      className: "first"
    }, React.createElement("h1",{},"React"),React.createElement("h2",{},"React"),React.createElement("h3",{},"React"))

    //创建容器并渲染虚拟DOM
    ReactDOM.createRoot(document.getElementById('app')).render(vDom) */



    //1.
    // const vDom = React.createElement('h1',{className : "first"},"Hellow React")

    // 2.
    // const vDom = React.createElement('h1',{className:"first"},"Hellow React","Hellow World")

    // 3.
    const vDom = React.createElement('div',{className:"first"},
    React.createElement('h1',{},"React"),
    React.createElement('h2',{},"React"),
    React.createElement('h3',{},"React"),
    React.createElement('h4',{},"React"),
    React.createElement('h5',{},"React"),
    React.createElement('h6',{},"React"),)


    //创建容器并渲染虚拟DOM
    ReactDOM.createRoot(document.getElementById('app')).render(vDom)
  </script>
</body>

</html>